import { getAction, deleteAction, putAction, postAction, httpAction, downFile } from '@/api/manage'

const serviceName = '/sjsk-person-service'
/*-----------社戒社康人员管理-----------*/
//人员列表
const getPersonList = (params) => getAction(`${serviceName}/sjskPerson/list`, params)
//非就业安置人员列表
const getNotEmploymentPersonList = (params) => getAction(`${serviceName}/holographicArchives/getNotEmploymentPersonList`, params)
//变更执行地-列表
const getChangePlaceList = (params) => getAction(`${serviceName}/sjskPerson/changePlaceList`, params)
//账户管理
const modifyAccount = (params) => postAction(`${serviceName}/sjskPerson/modifyAccount`, params)
//重置密码
const resetPassword = (params) => postAction(`${serviceName}/sjskPerson/resetPassword`, params)
//同城转介申请
const cityReferralApply = (params) => postAction(`${serviceName}/sjskPerson/cityReferralApply`, params)
//变更执行地申请
const changePlaceApply = (params) => postAction(`${serviceName}/sjskPerson/changePlaceApply`, params)
//异地管控申请
const remoteControlApply = (params) => postAction(`${serviceName}/sjskPerson/remoteControlApply`, params)
//中止申请
const abortApply = (params) => postAction(`${serviceName}/sjskPerson/abortApply`, params)
//继续执行申请
const continueApply = (params) => postAction(`${serviceName}/sjskPerson/continueApply`, params)
//请假申请
const outLeaveApply = (params) => postAction(`${serviceName}/sjskPerson/outLeaveApply`, params)
//销假
const resumptionLeave = (id) => postAction(`${serviceName}/sjskPerson/resumptionLeave/${id}`)
//根据社戒社康id查询请假记录
const getOutLeaveRecordList = (id) => getAction(`${serviceName}/apply/getOutLeaveRecordList/${id}`)
//美沙酮入组
const mstPersonJoinApply = (params) => postAction(`/sjsk-clinicmanage-service/sjsk/person/mstPersonJoin`, params)
//获取所有门诊名称和地区信息
const allClinicInfo = (params) => postAction(`/sjsk-clinicmanage-service/sjsk/clinic/allClinicInfo`, params)
//人员入组次数
const getMstPersonCount = (params) => getAction(`/sjsk-clinicmanage-service/sjsk/person/getMstPersonCount`, params)
//人员列表导出
const sjskExport = (params) => downFile(`${serviceName}/sjskPerson/sjskExport`, params, 'post')
//变更执行地-导出
const changePlaceExport = (params) => downFile(`${serviceName}/sjskPerson/changePlaceExport`, params, 'post')

/*-----------社会面有吸毒史人员管理-----------*/
//人员导入
export const socialPersonImportUrl = `${serviceName}/import/socialPerson`
//人员列表
const getSocialPersonList = (params) => getAction(`${serviceName}/socialPerson/getList`, params)
//人员新增或编辑
const addSocialPerson = (params) => postAction(`${serviceName}/socialPerson/addSocialPerson`, params)
//根据id查询获取社会面人员信息
const getSocialPersonInfo = (id) => getAction(`${serviceName}/socialPerson/getSocialPersonInfo/${id}`)
//人员分配
const socialDistribution = (params) => postAction(`${serviceName}/socialPerson/personDistribution`, params)
//解除分配
const socialRemoveDistribution = (id) => getAction(`${serviceName}/socialPerson/removeDistribution/${id}`)
//导出
const socialPersonExport = (params) => downFile(`${serviceName}/socialPerson/export`, params, 'post')

/*---------异地管控-----------*/
//社戒社康-省内异地管控列表
const getInsideList = (params) => getAction(`${serviceName}/remoteControl/getInsideList`, params)
//社戒社康-省外异地管控列表
const getOutsideList = (params) => getAction(`${serviceName}/remoteControl/getOutsideList`, params)
//社戒社康-异地管控工作通报-工作通报列表
const getWorkNotificationList = (params) => getAction(`${serviceName}/sjskPerson/getWorkNotificationList`, params)
//社戒社康-省外异地管控-异常上报列表
const getAbnormalReportList = (params) => getAction(`${serviceName}/remoteControl/getAbnormalReportList`, params)
//异地管控-人员分配
const personDistribution = (params) => postAction(`${serviceName}/remoteControl/personDistribution`, params)
//异地管控-解除分配
const removeDistribution = (params) => postAction(`${serviceName}/remoteControl/removeDistribution`, params)
//省外异地管控-转出省外-异常上报申请
const abnormalReportApply = (params) => postAction(`${serviceName}/remoteControl/abnormalReportApply`, params)
//省外异地管控-转出省外-存档材料
const filingMaterials = (params) => postAction(`${serviceName}/remoteControl/filingMaterials`, params)
//工作通报导出
const workNotificationExport = (params) => downFile(`${serviceName}/sjskPerson/workNotificationExport`, params, 'post')
//省内异地管控导出
const insideExport = (params) => downFile(`${serviceName}/remoteControl/insideExport`, params, 'post')
//省外异地管控导出
const outsideExport = (params) => downFile(`${serviceName}/remoteControl/outsideExport`, params, 'post')
//省外异地管控-异常上报-导出
const abnormalReportExport = (params) => downFile(`${serviceName}/remoteControl/abnormalReportExport`, params, 'post')
//社会面有吸毒史人员-省内异地管控列表
const getSocialInsideList = (params) => getAction(`${serviceName}/socialPerson/getSocialInsideList`, params)
//社会面有吸毒史人员-省内异地管控导出
const socialInsideExport = (params) => downFile(`${serviceName}/socialPerson/getSocialInsideExport`, params, 'post')

/*---------省外异地管控申请-----------*/
//省外异地管控-外省转入申请
const otherProvinceIntoApply = (params) => postAction(`${serviceName}/remoteControl/otherProvinceIntoApply`, params)
//撤销异地管控-转出省外申请
const outOtherProvinceApply = (params) => postAction(`${serviceName}/remoteControl/outOtherProvinceApply`, params)
//根据身份证查询省外异地管控信息
const getOutsideByIdentityCard = (identityCard) => getAction(`${serviceName}/apply/getOutsideByIdentityCard/${identityCard}`)

/*----社会面、社戒社康、省外异地管控（转入）---- */
//帮扶救助>其他救助人员列表
const getRescuePersonList = (params) => getAction(`${serviceName}/sjskPerson/getRescuePersonList`, params)

/*---------工作通报配置-----------*/
//工作通报配置
const workNotificationConfig = (params) => postAction(`${serviceName}/sjskPerson/workNotificationConfig`, params)
//根据类型获取工作通报配置
const getWorkNotificationConfig = (type) => getAction(`${serviceName}/apply/getWorkNotificationConfig/${type}`)
//工作通报公示
const publicity = (id) => postAction(`${serviceName}/sjskPerson/publicity/${id}`)

export {
  getPersonList,
  getNotEmploymentPersonList,
  getChangePlaceList,
  modifyAccount,
  resetPassword,
  cityReferralApply,
  changePlaceApply,
  remoteControlApply,
  abortApply,
  continueApply,
  outLeaveApply,
  resumptionLeave,
  getOutLeaveRecordList,
  mstPersonJoinApply,
  allClinicInfo,
  getMstPersonCount,
  sjskExport,
  changePlaceExport,

  getSocialPersonList,
  addSocialPerson,
  getSocialPersonInfo,
  socialDistribution,
  socialRemoveDistribution,
  socialPersonExport,

  getInsideList,
  getOutsideList,
  workNotificationExport,
  getWorkNotificationList,
  getAbnormalReportList,
  personDistribution,
  removeDistribution,
  abnormalReportApply,
  filingMaterials,
  insideExport,
  outsideExport,
  abnormalReportExport,
  getSocialInsideList,
  socialInsideExport,

  otherProvinceIntoApply,
  outOtherProvinceApply,
  getOutsideByIdentityCard,

  getRescuePersonList,

  workNotificationConfig,
  getWorkNotificationConfig,
  publicity
}
